package jsjf;

public class LinearNode1<T> {
    LinearNode1<T> next,previous;
    private T element;

    // 创建空指针
    public LinearNode1()
    {
        next = null;
        element = null;
        previous = null;
    }

    // 创建指针存储元素
    public LinearNode1 (T elem)
    {
        next = null;
        element = elem;
        previous = null;
    }

    // 返回下一个指针
    public LinearNode1<T> getNext()
    {
        return next;
    }

    // 返回上一个指针
    public LinearNode1<T> getPrevious()
    {
        return previous;
    }

    // 更改下一个指针
    public void setNext (LinearNode1<T> node)
    {
        next = node;
    }

    // 更改上一个指针
    public void setPrevious (LinearNode1<T> node)
    {
        previous = node;
    }

    // 返回指针中的元素
    public T getElement()
    {
        return element;
    }

    // 更改指针中的元素
    public void setElement (T elem)
    {
        element = elem;
    }
}
